<?php

namespace common\models\user;

use Yii;

/**
 * This is the model class for table "user".
 *
 * @property int $id
 * @property string $username 用户名
 * @property string $password 密码
 * @property string $phone
 * @property string $real_name
 * @property int|null $status 状态
 * @property string|null $create_time
 */
class User extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'user';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['status'], 'integer'],
            [['create_time'], 'safe'],
            [['username', 'phone'], 'string', 'max' => 20],
            [['password'], 'string', 'max' => 255],
            [['real_name'], 'string', 'max' => 50],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'username' => 'Username',
            'password' => 'Password',
            'phone' => 'Phone',
            'real_name' => 'Real Name',
            'status' => 'Status',
            'create_time' => 'Create Time',
        ];
    }
}
